package com.qf.controller;

import com.qf.dto.ProductDTO;
import com.qf.service.ProductInfoService;
import com.qf.utils.ResultVOUtils;
import com.qf.vo.ResultVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 2019/10/14
 * Administrator
 * springbootapp1014
 * 面向对象面向君  不负代码不负卿
 */
@RestController
@RequestMapping("/buyer/product")
public class ProductInfoController {

    @Resource
    private ProductInfoService infoService;
    //@RequestMapping(method = RequestMethod.GET,value = "/list")
    @GetMapping("/list")
    public ResultVo<List<ProductDTO>> getdata(){

        List<ProductDTO> list = infoService.findList();
        ResultVo success = new ResultVOUtils<List<ProductDTO>>().success(list);
        return success;
    }
}
